package org.darkforest.common.services.impl;

import org.darkforest.common.services.EvaluateGoodsService;
import org.darkforest.dao.mapper.EvaluateGoodsMapper;
import org.darkforest.model.EvaluateGoods;
import org.darkforest.model.EvaluateGoodsSearchBean;
import org.darkforest.model.EvaluateGoodsVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2015/8/16.
 */
@Service
public class EvaluateGoodsServiceImpl implements EvaluateGoodsService {
    @Autowired
    private EvaluateGoodsMapper evaluateGoodsMapper;




    /**
     * 根据商品ID获取商品评价
     *
     * @param evaluateGoodsSearchBean
     * @return
     */
    @Override
    public EvaluateGoodsSearchBean selectByCondation(EvaluateGoodsSearchBean evaluateGoodsSearchBean) {

        List<EvaluateGoodsVo> evaluateGoodses = evaluateGoodsMapper.selectByCondation(evaluateGoodsSearchBean);
        evaluateGoodsSearchBean.setResultList(evaluateGoodses);
        return evaluateGoodsSearchBean;
    }

    @Override
    public void deleteByIds(List nList) {
        evaluateGoodsMapper.deleteByIds(nList);
    }
}
